package com.yc.sole.erp.enums;

import com.fasterxml.jackson.annotation.JsonValue;
import com.yc.sole.common.enums.IBaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author yizuomin
 * @date 2024/1/13 13:20
 **/
@Getter
@AllArgsConstructor
public enum ProduceState implements IBaseEnum<String> {

    /**
     *
     */
    IN_PRODUCTION("0", "生产中"),
    SUSPEND("1", "暂停中"),
    FINISHED("2", "已完成"),
    CANCEL("3", "已取消");

    @JsonValue
    private final String value;
    private final String description;

    public static String getByValue(String value) {
        for (ProduceState state : ProduceState.values()) {
            if (state.getValue().equals(value)) {
                return state.getDescription();
            }
        }
        return null;
    }
}
